﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace MessMain
{    
    public partial class ConfAcc : Form
    {
        private string limba;

        public ConfAcc(string limba)
        {
            InitializeComponent();
            Rename(limba);

            this.limba = limba;
        }

        private void button1_Click(object sender, EventArgs e)
        {
                        
            c.Invoke((MethodInvoker)delegate
            {
                tbi.c = c;
                tbi.myName = Comunication.myName;
                char[] seps = { ' ' };
                string[] values = rms.confUsrs.Split(seps);
                for (int i = 0; i < values.Length; i++)
                {
                    if (i == (values.Length - 1))
                    {
                        tbi.addUser(values[i]);
                    }
                    else
                        tbi.addUser(values[i]);
                }
                tbi.confName = rms.confName;
                tbi.isConf = true;
                tbi.updateConf();               
                c.tablist.Add(tbi);
                c.setCtlTab2(tbi);
            });
            this.Dispose(); 
        }
    }
}
